package com.example.workspace.DIdemo;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestSpring5 {
    public static void main(String[] args) {
        //加载spring配置文件
        ApplicationContext context =
                new ClassPathXmlApplicationContext("bean1.xml");
        //获取配置创建对象
        Book book = context.getBean("book",Book.class);
        System.out.println(book);
        book.testDemo();
    }
}
